• Stars
    star
    726
  • Rank 62,418 (Top 2 %)
  • Language
    Rust
  • License
    GNU General Publi...
  • Created over 5 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The dApp hub for blockchains of the future

astar-cover

Integration Action GitHub tag (latest by date) Substrate version License
Twitter URL Twitter URL YouTube Docker Discord Telegram Medium

Astar Network is an interoperable blockchain based the Substrate framework and the hub for dApps within the Polkadot Ecosystem. With Astar Network and Shiden Network, people can stake their tokens to a Smart Contract for rewarding projects that provide value to the network.

For contributing to this project, please read our Contribution Guideline.

Building From Source

This section assumes that the developer is running on either macOS or Debian-variant operating system. For Windows, although there are ways to run it, we recommend using WSL or from a virtual machine for stability.

Execute the following command from your terminal to set up the development environment and build the node runtime.

# install Substrate development environment via the automatic script
$ curl https://getsubstrate.io -sSf | bash -s -- --fast

# clone the Git repository
$ git clone --recurse-submodules https://github.com/AstarNetwork/Astar.git

# change current working directory
$ cd Astar

# compile the node
# note: you may encounter some errors if `wasm32-unknown-unknown` is not installed, or if the toolchain channel is outdated
$ cargo build --release

# show list of available commands
$ ./target/release/astar-collator --help

Building with Nix

# install Nix package manager:
$ curl https://nixos.org/nix/install | sh

# run from root of the project folder (`Astar/` folder)
$ nix-shell -I nixpkgs=channel:nixos-21.05 third-party/nix/shell.nix --run "cargo build --release"

Running a Collator Node

To set up a collator node, you must have a fully synced node with the proper arguments, which can be done with the following command.

# start the Shiden collator node with
$ ./target/release/astar-collator \
  --base-path <path to save blocks> \
  --name <node display name> \
  --port 30333 \
  --rpc-port 9944 \
  --telemetry-url 'wss://telemetry.polkadot.io/submit/ 0' \
  --rpc-cors all \
  --collator

Now, you can obtain the node's session key by sending the following RPC payload.

# send `rotate_keys` request
$ curl -H 'Content-Type: application/json' --data '{ "jsonrpc":"2.0", "method":"author_rotateKeys", "id":1 }' localhost:9933

# should return a long string of hex, which is your session key
{"jsonrpc":"2.0","result":"<session key in hex>","id":1}

After this step, you should have a validator node online with a session key for your node. For key management and validator rewards, consult our validator guide online.

Run RPC Tests

RPC tests suite can be run for any release. To run tests go to https://github.com/AstarNetwork/Astar/actions/workflows/rpcTest.yml. Click Run workflow, in the dropdown input the release version tag you want to run the test suite. Then click the green Run workflow button to start the test suite.

Screenshot from 2022-07-07 15-28-46

Workspace Dependency Handling

All dependencies should be listed inside the workspace's root Cargo.toml file. This allows us to easily change version of a crate used by the entire repo by modifying the version in a single place.

Right now, if non_std is required, default-features = false must be set in the root Cargo.toml file (related to this issue). Otherwise, it will have no effect, causing your compilation to fail. Also package imports aren't properly propagated from root to sub-crates, so defining those should be avoided.

Defining features in the root Cargo.toml is additive with the features defined in concrete crate's Cargo.toml.

Adding Dependency

  1. Check if the dependency is already defined in the root Cargo.toml
    1. if yes, nothing to do, just take note of the enabled features
    2. if no, add it (make sure to use default-features = false if dependency is used in no_std context)
  2. Add new_dependecy = { workspace = true } to the required crate
  3. In case dependency is defined with default-features = false but you need it in std context, add features = ["std"] to the required crate.

Further Reading

More Repositories

1

astar-docs

JavaScript
267
star
2

growth-program

Astar Ecosystem Growth Program
77
star
3

astar-apps

The official Astar Network portal for accessing your tokens and other native features!
CSS
68
star
4

astar-frame

Core frame modules for Astar & Shiden network.
Rust
58
star
5

swanky-cli

The all-in-one developer environment for Parity WASM smart contracts!
TypeScript
46
star
6

ZKRollups

ZK Rollups pallet implementation
TypeScript
39
star
7

plasmdocs

The general user documentation for Astar Network
Rust
35
star
8

swanky-node

Rust
33
star
9

astar.js

Astar network Typescript SDK
TypeScript
30
star
10

ink-xvm-sdk

The Ink! smart contract SDK for XVM interface.
Rust
27
star
11

lockdrop-ui

Plasm Network lockdrop web application
TypeScript
18
star
12

aWASoMe

An aWASoMe list of awesome things curated by the Dotsama community.
16
star
13

plonk

Rust
16
star
14

ink-playground

TypeScript
16
star
15

builders-program

Solidity
14
star
16

wasm-flipper

TypeScript
14
star
17

astarbase

EVM smart contract for address mapping ss58 <> H160
Solidity
11
star
18

chain-extension-contracts

Rust
10
star
19

astar-token-api

The public API for Astar and Shiden token values
TypeScript
10
star
20

wasm-showcase-dapps

Rust
8
star
21

AstarBounties

Astar bounties during hackathons.
8
star
22

astar-faucet-bot

Astar test network faucet bot
TypeScript
8
star
23

sumi

Astar binding generator for Solidity and ink!
Rust
7
star
24

ink-redible-nft

NFT viewer dApp
TypeScript
7
star
25

Audits

Comprehensive Repository of Audit Reports
6
star
26

swanky-dev-container

A VS Code dev container with Swanky and all the dependencies preinstalled
6
star
27

astar-ui

UI library for all Astar projects
Vue
5
star
28

ethereum-bridge-old

Rust
5
star
29

swanky-plugin-phala

Handlebars
5
star
30

astarwebsite_v2

Astar main website.
Vue
4
star
31

dApp-Staking-Workshop

Rust
4
star
32

WASM-Governor-Workshop

Rust
4
star
33

crowdloan-app

Astar network official Polkadot crowdloan campaign contribution page
Vue
4
star
34

brand-assets

Brand assets related to Astar ecosystem
4
star
35

wasm-tutorial-dex

Rust
4
star
36

astar-homepage

The landing page for Astar Network
EJS
4
star
37

gas-station

Gas price estimation api
TypeScript
3
star
38

dapps-staking-indexer

TypeScript
3
star
39

astar.js-dapp-template

Template for setting up Dapp with astar.js
TypeScript
3
star
40

astar-community-tutorials

The "Astar Community Tutorials" is a space dedicated to guides and tutorials created by Astar ecosystem agents and community users for using or building on Astar network.
JavaScript
3
star
41

api

Astar Network library for dApps and client applications
TypeScript
3
star
42

plasm-apps-vue

The front-end application for Plasm Network
Vue
3
star
43

dapps-staking-indexer-v3

TypeScript
3
star
44

astar-ink-sdk

Rust
2
star
45

astar-alerts

Monitoring large moves on tokens.
TypeScript
2
star
46

metamask-snap-astar

TypeScript
2
star
47

wasm-lottery

Simple lottery contract example in wasm ink
TypeScript
1
star
48

frontend-interview-task

1
star
49

astarwebsite_v2_korean

Vue
1
star
50

polkadotjs-ecdsa-hardware

1
star
51

swanky-template-ink

Rust
1
star
52

astar-chainlink

JavaScript
1
star
53

EVM-XCM-Examples

Solidity
1
star
54

graph-endpoints

This repository contains documentation on how to deploy subgraphs to the Astar TheGraph infrastructure.
1
star
55

yoki-template-test

Template test for Yoki Origins contracts
Solidity
1
star