Add barebones anchor generated skeleton.

Change-Id: Ia8e77942ea31521f09fbb1586349d02a21508444
This commit is contained in:
Reisen 2021-04-23 10:23:32 +00:00
parent 31a94eeb79
commit fa84f69f12
8 changed files with 74 additions and 0 deletions

9
solana/anchor-bridge/.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
# ignore Mac OS noise
.DS_Store
# ignore the build directory for Rust/Anchor
target
# Ignore backup files creates by cargo fmt.
**/*.rs.bk

View File

@ -0,0 +1,2 @@
cluster = "localnet"
wallet = "/root/.config/solana/id.json"

View File

@ -0,0 +1,4 @@
[workspace]
members = [
"programs/*"
]

View File

@ -0,0 +1,13 @@
// Migrations are an early feature. Currently, they're nothing more than this
// single deploy script that's invoked from the CLI, injecting a provider
// configured from the workspace's Anchor.toml.
const anchor = require("@project-serum/anchor");
module.exports = async function (provider) {
// Configure client to use the provider.
anchor.setProvider(provider);
// Add your deploy script here.
}

View File

@ -0,0 +1,18 @@
[package]
name = "anchor-bridge"
version = "0.1.0"
description = "Created with Anchor"
edition = "2018"
[lib]
crate-type = ["cdylib", "lib"]
name = "anchor_bridge"
[features]
no-entrypoint = []
no-idl = []
cpi = ["no-entrypoint"]
default = []
[dependencies]
anchor-lang = "0.4.4"

View File

@ -0,0 +1,2 @@
[target.bpfel-unknown-unknown.dependencies.std]
features = []

View File

@ -0,0 +1,12 @@
use anchor_lang::prelude::*;
#[program]
pub mod anchor_bridge {
use super::*;
pub fn initialize(ctx: Context<Initialize>) -> ProgramResult {
Ok(())
}
}
#[derive(Accounts)]
pub struct Initialize {}

View File

@ -0,0 +1,14 @@
const anchor = require('@project-serum/anchor');
describe('anchor-bridge', () => {
// Configure the client to use the local cluster.
anchor.setProvider(anchor.Provider.env());
it('Is initialized!', async () => {
// Add your test here.
const program = anchor.workspace.AnchorBridge;
const tx = await program.rpc.initialize();
console.log("Your transaction signature", tx);
});
});