title: ๊ตฌ์ฑ metaTitle: ๊ตฌ์ฑ | Amman
์คํํ ๋ Amman์ ํ๋ก์ ํธ ๋ฃจํธ์์ ๊ตฌ์ฑ ํ์ผ .ammanrc.js๋ฅผ ์ฐพ์ต๋๋ค. ์ด ํ์ผ์ด ์์ผ๋ฉด Amman์ ๊ธฐ๋ณธ ๊ตฌ์ฑ์ผ๋ก ๋ก๋๋ฉ๋๋ค.
๊ตฌ์ฑ์ ์๋ ์์ฑ ์ค ํ๋์ ํจ๊ป 'validator'๋ฅผ ๋ด๋ณด๋ด๋ JavaScript ๋ชจ๋์ด์ด์ผ ํฉ๋๋ค:
๋ค์์ ์ถ๊ฐ๋ ํ๋ก๊ทธ๋จ๊ณผ relay ๋ฐ storage ๊ตฌ์ฑ์ ์ ์ธํ๊ณ ๋ชจ๋ ๊ฐ์ด ๊ธฐ๋ณธ๊ฐ์ผ๋ก ์ค์ ๋ ๊ตฌ์ฑ ์์ ์
๋๋ค.
_amman-explorer relay_๋ CI ํ๊ฒฝ์์ ์คํ๋์ง ์๋ ํ ๊ฒ์ฆ์์ ํจ๊ป ์๋์ผ๋ก ์์๋๋ฉฐ, ์๋ ค์ง _relay port_์์ ๋ฆด๋ ์ด๊ฐ ์ด๋ฏธ ์คํ ์ค์ธ ๊ฒฝ์ฐ ๋จผ์ ์ข ๋ฃ๋ฉ๋๋ค.
_mock storage_๋ storage ๊ตฌ์ฑ์ด ์ ๊ณต๋ ๊ฒฝ์ฐ์๋ง ์์๋ฉ๋๋ค. ์๋ ค์ง _storage port_์์ ์คํ ๋ฆฌ์ง ์๋ฒ๊ฐ ์ด๋ฏธ ์คํ ์ค์ธ ๊ฒฝ์ฐ ๋จผ์ ์ข
๋ฃ๋ฉ๋๋ค.
import { LOCALHOST, tmpLedgerDir } from '@metaplex-foundation/amman'
module.exports = {
validator: {
killRunningValidators: true,
programs: [
{
label: 'Token Metadata Program',
programId: programIds.metadata,
deployPath: localDeployPath('mpl_token_metadata'),
},
],
jsonRpcUrl: LOCALHOST,
websocketUrl: '',
commitment: 'confirmed',
ledgerDir: tmpLedgerDir(),
resetLedger: true,
verifyFees: false,
detached: process.env.CI != null,
},
relay: {
enabled: process.env.CI == null,
killRunningRelay: true,
},
storage: {
enabled: process.env.CI == null,
storageId: 'mock-storage',
clearOnStart: true,
},
}
Amman์ ์ ํํ ํด๋ฌ์คํฐ์์ ๋ก์ปฌ ์ฌ์ฉ ๋ฐ ํ ์คํธ๋ฅผ ์ํด ๊ณ์ ๊ณผ ํ๋ก๊ทธ๋จ์ ๋ชจ๋ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค.
module.exports = {
validator: {
// ๊ธฐ๋ณธ์ ์ผ๋ก Amman์ accountsCluster์์ ๊ณ์ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์ต๋๋ค (๊ณ์ ๋ณ๋ก ์ฌ์ ์ ๊ฐ๋ฅ)
accountsCluster: 'https://api.metaplex.solana.com',
accounts: [
{
label: 'Token Metadata Program',
accountId: 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s',
// executable์ true๋ก ํ์ํ๋ฉด Amman์ด ์คํ ๊ฐ๋ฅํ ๋ฐ์ดํฐ ๊ณ์ ๋ ์๋์ผ๋ก ๊ฐ์ ธ์ต๋๋ค
executable: true,
},
{
label: 'Random other account',
accountId: '4VLgNs1jXgdciSidxcaLKfrR9WjATkj6vmTm5yCwNwui',
// ๊ธฐ๋ณธ์ ์ผ๋ก executable์ false์ด๋ฉฐ ๊ตฌ์ฑ์ ํฌํจ๋ ํ์๊ฐ ์์ต๋๋ค
// executable: false,
// ์ฌ๊ธฐ์ ํด๋ฌ์คํฐ๋ฅผ ์ ๊ณตํ๋ฉด accountsCluster ํ๋๋ฅผ ์ฌ์ ์ํฉ๋๋ค
cluster: 'https://metaplex.devnet.rpcpool.com',
},
],
},
}
_devnet_๊ณผ ๊ฐ์ ๋ค๋ฅธ ํด๋ฌ์คํฐ์ ๊ฒฝ์ฐ ์ผ๋ถ ๊ธฐ๋ฅ์ด ๋นํ์ฑํ๋ฉ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก ๋ก์ปฌ์์ ์คํ๋๋ solana-test-validator๋ ์ด๋ค ๊ธฐ๋ฅ๋ ๋นํ์ฑํํ์ง ์์ผ๋ฏ๋ก ์ ๊ณต๋ ํด๋ฌ์คํฐ์ ๋ค๋ฅด๊ฒ ์๋ํฉ๋๋ค.
ํน์ ํด๋ฌ์คํฐ์ ๋ํด ์คํ๋ ๋ฐฉ์์ ๋ ๊ฐ๊น์ด ์๋๋ฆฌ์ค์์ ํ ์คํธ๋ฅผ ์คํํ๋ ค๋ฉด matchFeatures ๊ตฌ์ฑ ์์ฑ์ ํตํด ํด๋น ๊ธฐ๋ฅ์ ์ผ์น์ํฌ ์ ์์ต๋๋ค:
module.exports = {
validator: {
...
// ์๋๋ `mainnet-beta` ํด๋ฌ์คํฐ์ ๋ํด ๋นํ์ฑํ๋ ๋ชจ๋ ๊ธฐ๋ฅ์ ๋นํ์ฑํํฉ๋๋ค
matchFeatures: 'mainnet-beta',
}
}
๊ธฐ๋ฅ ์ธํธ๋ฅผ ๋ช ์์ ์ผ๋ก ๋นํ์ฑํํ๋ ค๋ฉด deactivateFeatures ์์ฑ์ ํตํด ๊ทธ๋ ๊ฒ ํ ์ ์์ต๋๋ค:
module.exports = {
validator: {
...
deactivateFeatures: ['21AWDosvp3pBamFW91KB35pNoaoZVTM7ess8nr2nt53B'],
}
}
์ฐธ๊ณ : ์์ ์์ฑ ์ค ํ๋๋ง ์ค์ ํ ์ ์์ต๋๋ค