Add barebones anchor generated skeleton.
Change-Id: Ia8e77942ea31521f09fbb1586349d02a21508444
This commit is contained in:
parent
31a94eeb79
commit
fa84f69f12
|
@ -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
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
cluster = "localnet"
|
||||||
|
wallet = "/root/.config/solana/id.json"
|
|
@ -0,0 +1,4 @@
|
||||||
|
[workspace]
|
||||||
|
members = [
|
||||||
|
"programs/*"
|
||||||
|
]
|
|
@ -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.
|
||||||
|
}
|
|
@ -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"
|
|
@ -0,0 +1,2 @@
|
||||||
|
[target.bpfel-unknown-unknown.dependencies.std]
|
||||||
|
features = []
|
|
@ -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 {}
|
|
@ -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);
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue